nethackfandomcom-20200214-history
Source:NetHack 3.1.0/config.h
Below is the full text to config.h from the source code of NetHack 3.1.0. To link to a particular line, write [[NetHack 3.1.0/config.h#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)config.h 3.1 92/08/29 */ 2. /* Copyright © Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef CONFIG_H /* make sure the compiler does not see the typedefs twice */ 6. #define CONFIG_H 7. 8. 9. /* 10. * Section 1: OS selection. 11. * Select the version of the OS you are using. 12. * For "UNIX" select either SYSV or BSD in unixconf.h. 13. * A "VMS" option is not needed since the VMS C-compilers 14. * provide it (no need to change sec#1, vmsconf.h handles it). 15. */ 16. 17. #define UNIX /* delete if no fork(), exec() available */ 18. 19. /* 20. * MS DOS - compilers 21. * 22. * Microsoft C auto-defines MSDOS, 23. * Borland C auto-defines __TURBOC__, 24. * DJGPP auto-defines MSDOS. 25. */ 26. 27. /* #define MSDOS /* use if not defined by compiler or cases below */ 28. 29. #ifdef __TURBOC__ 30. # define MSDOS 31. #endif 32. 33. #ifdef MSDOS 34. # undef UNIX 35. #endif 36. 37. /* 38. * Mac Stuff. 39. */ 40. 41. #ifdef applec /* MPW auto-defined symbol */ 42. # define MAC 43. # undef UNIX /* Just in case */ 44. #endif 45. /* #define MAC /* We're on some mac-ish platform */ 46. 47. #ifdef MAC 48. # ifdef THINK_C 49. # define NEED_VARARGS 50. # endif 51. #endif 52. 53. /* 54. * Amiga setup. 55. */ 56. #ifdef AZTEC_C /* Manx auto-defines this */ 57. # ifdef MCH_AMIGA /* Manx auto-defines this for AMIGA */ 58. # ifndef AMIGA 59. #define AMIGA /* define for Commodore-Amiga */ 60. # endif /* (Lattice auto-defines AMIGA) */ 61. #define AZTEC_50 /* define for version 5.0 of manx */ 62. # endif 63. #endif 64. #ifdef LATTICE 65. # define NEARDATA __near /* put some data close */ 66. # define NO_SCAN_BRACK /* scanf doesn't handle [] (this define available 67. * for any system with this problem) */ 68. #else 69. # define NEARDATA 70. #endif 71. #ifdef AMIGA 72. # ifdef UNIX 73. "Please re-read the compilation documentation. Thank you." 74. # endif 75. #endif 76. 77. /* 78. * Atari auto-detection 79. */ 80. 81. #ifdef atarist 82. # undef UNIX 83. # define TOS 84. #else 85. # ifdef __MINT__ 86. # undef UNIX 87. # define TOS 88. # endif 89. #endif 90. 91. /* 92. * and other systems... 93. */ 94. 95. /* #define OS2 /* define for OS/2 */ 96. 97. /* #define TOS /* define for Atari ST/TT */ 98. 99. /* #define STUPID /* avoid some complicated expressions if 100. your C compiler chokes on them */ 101. /* #define TERMINFO /* uses terminfo rather than termcap */ 102. /* should be defined for HPUX and most, but not all, 103. SYSV */ 104. /* in particular, it should NOT be defined for the 105. * UNIXPC unless you remove the use of the shared 106. * library in the makefile */ 107. /* #define MINIMAL_TERM /* if a terminal handles highlighting or tabs poorly, 108. try this define, used in pager.c and termcap.c */ 109. /* #define ULTRIX_CC20 /* define only if using cc v2.0 on a DECstation */ 110. /* #define ULTRIX_PROTO /* define for Ultrix 4.0 (or higher) on a DECstation; 111. * if you get compiler errors, don't define this. */ 112. /* Hint: if you're not developing code, don't define 113. ULTRIX_PROTO. */ 114. 115. #ifdef AMIGA 116. # define NEED_VARARGS 117. #endif 118. 119. #ifdef VMS /* really old compilers need special handling, detected here */ 120. # undef UNIX 121. # ifdef __DECC /* buggy early versions want widened prototypes */ 122. # define NOTSTDC /* except when typedefs are involved */ 123. # define USE_VARARGS 124. # undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */ 125. # else 126. # ifdef VAXC /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */ 127. # ifdef ANCIENT_VAXC /* vaxc v2.2 and earlier of warnings to come */ 128. # define KR1ED /* simulate defined() */ 129. # define USE_VARARGS 130. # else /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */ 131. # if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/ 132. # define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */ 133. # define signed /* well, almost close enough */ 134. #include 135. # define UNWIDENED_PROTOTYPES 136. # endif 137. # define USE_STDARG 138. # endif 139. # endif /*VAXC*/ 140. # endif /*__DECC*/ 141. # ifdef VERYOLD_VMS /* v4.5 or earlier; no longer available for testing */ 142. # define USE_OLDARGS /* is there, vprintf & vsprintf aren't */ 143. # ifdef USE_VARARGS 144. # undef USE_VARARGS 145. # endif 146. # ifdef USE_STDARG 147. # undef USE_STDARG 148. # endif 149. # endif 150. #endif /*VMS*/ 151. 152. #ifdef vax 153. /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */ 154. # ifdef ULTRIX_PROTO 155. # undef ULTRIX_PROTO 156. # endif 157. # ifdef ULTRIX_CC20 158. # undef ULTRIX_CC20 159. # endif 160. #endif 161. 162. #ifdef KR1ED /* For compilers which cannot handle defined() */ 163. #define defined(x) (-x-1 != -1) 164. /* Because: 165. * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1 166. * #define FOO 1 or on command-line -DFOO 167. * => defined(1) => (-1 != - 1 - 1) => 1 168. * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1 169. * for -DFOO, oh well. 170. * => defined(0) => (-1 != - 0 - 1) => 0 171. * 172. * But: 173. * defined("") => (-1 != - "" - 1) 174. * is an unavoidable catastrophe. 175. */ 176. #endif 177. 178. /* Windowing systems... 179. * Define all of those you want supported in your binary. 180. * Some combinations make no sense. See the installation document. 181. */ 182. #define TTY_GRAPHICS /* good old tty based graphics */ 183. /* #define X11_GRAPHICS /* X11 interface */ 184. 185. /* 186. * Define the default window system. This should be one that is compiled 187. * into your system (see defines above). Known window systems are: 188. * 189. * tty, X11, mac, amii 190. */ 191. 192. /* MAC also means MAC windows */ 193. #ifdef MAC 194. # ifndef AUX 195. # undef TTY_GRAPHICS 196. # undef X11_GRAPHICS 197. # define DEFAULT_WINDOW_SYS "mac" 198. # endif 199. #endif 200. 201. /* no options yet: Amiga also means Intuition windows */ 202. #ifdef AMIGA 203. # undef TTY_GRAPHICS 204. # define DEFAULT_WINDOW_SYS "amii" 205. #endif 206. 207. #ifndef DEFAULT_WINDOW_SYS 208. # define DEFAULT_WINDOW_SYS "tty" 209. #endif 210. 211. 212. 213. /* 214. * Section 2: Some global parameters and filenames. 215. * Commenting out WIZARD, LOGFILE, or NEWS removes that feature 216. * from the game; otherwise set the appropriate wizard name. 217. * LOGFILE and NEWS refer to files in the playground. 218. */ 219. 220. #ifndef WIZARD /* allow for compile-time or Makefile changes */ 221. # ifndef KR1ED 222. # define WIZARD "wizard" /* the person allowed to use the -D option */ 223. # else 224. # define WIZARD 225. # define WIZARD_NAME "wizard" 226. # endif 227. #endif 228. 229. #define LOGFILE "logfile" /* larger file for debugging purposes */ 230. #define NEWS "news" /* the file containing the latest hack news */ 231. 232. /* 233. * If COMPRESS is defined, it should contain the full path name of your 234. * 'compress' program. Defining INTERNAL_COMP causes NetHack to do 235. * simpler byte-stream compression internally. Both COMPRESS and 236. * INTERNAL_COMP create smaller bones/level/save files, but require 237. * additional code and time. Currently, only UNIX fully implements 238. * COMPRESS; other ports should be able to uncompress save files a 239. * la unixmain.c if so inclined. 240. */ 241. 242. #ifdef UNIX 243. # define COMPRESS "/usr/ucb/compress" /* path name for 'compress' */ 244. #endif 245. #ifndef COMPRESS 246. # define INTERNAL_COMP /* control use of NetHack's compression routines */ 247. #endif 248. 249. /* 250. * Defining INSURANCE slows down level changes, but allows games that 251. * died due to program or system crashes to be resumed from the point 252. * of the last level change, after running a utility program. 253. */ 254. #define INSURANCE /* allow crashed game recovery */ 255. 256. #ifndef MAC 257. # define CHDIR /* delete if no chdir() available */ 258. #endif 259. 260. #ifdef CHDIR 261. /* 262. * If you define HACKDIR, then this will be the default playground; 263. * otherwise it will be the current directory. 264. */ 265. #define HACKDIR "/usr/games/lib/nethackdir" /* nethack directory */ 266. 267. /* 268. * Some system administrators are stupid enough to make Hack suid root 269. * or suid daemon, where daemon has other powers besides that of reading or 270. * writing Hack files. In such cases one should be careful with chdir's 271. * since the user might create files in a directory of his choice. 272. * Of course SECURE is meaningful only if HACKDIR is defined. 273. */ 274. /* #define SECURE /* do setuid(getuid()) after chdir() */ 275. 276. /* 277. * If it is desirable to limit the number of people that can play Hack 278. * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. 279. * #define MAX_NR_OF_PLAYERS 6 280. */ 281. #endif /* CHDIR */ 282. 283. 284. 285. /* 286. * Section 3: Definitions that may vary with system type. 287. * For example, both schar and uchar should be short ints on 288. * the AT&T 3B2/3B5/etc. family. 289. */ 290. 291. /* 292. * Uncomment the following line if your compiler doesn't understand the 293. * 'void' type (and thus would give all sorts of compile errors without 294. * this definition). 295. */ 296. /* #define NOVOID /* define if no "void" data type. */ 297. 298. /* 299. * Uncomment the following line if your compiler falsely claims to be 300. * a standard C compiler (i.e., defines __STDC__ without cause). 301. * Examples are Apollo's cc (in some versions) and possibly SCO UNIX's rcc. 302. */ 303. /* #define NOTSTDC /* define for lying compilers */ 304. 305. #include "tradstdc.h" 306. 307. /* 308. * type schar: small signed integers (8 bits suffice) (eg. TOS) 309. * 310. * typedef char schar; 311. * 312. * will do when you have signed characters; otherwise use 313. * 314. * typedef short int schar; 315. */ 316. #ifdef AZTEC 317. # define schar char 318. #else 319. typedef signed char schar; 320. #endif 321. 322. /* 323. * type uchar: small unsigned integers (8 bits suffice - but 7 bits do not) 324. * 325. * typedef unsigned char uchar; 326. * 327. * will be satisfactory if you have an "unsigned char" type; 328. * otherwise use 329. * 330. * typedef unsigned short int uchar; 331. */ 332. typedef unsigned char uchar; 333. 334. /* 335. * Various structures have the option of using bitfields to save space. 336. * If your C compiler handles bitfields well (e.g., it can initialize structs 337. * containing bitfields), you can define BITFIELDS. Otherwise, the game will 338. * allocate a separate character for each bitfield. (The bitfields used never 339. * have more than 7 bits, and most are only 1 bit.) 340. */ 341. #define BITFIELDS /* Good bitfield handling */ 342. 343. /* #define STRNCMPI /* compiler/library has the strncmpi function */ 344. 345. /* 346. * There are various choices for the NetHack vision system. There is a 347. * choice of two algorithms with the same behavior. Defining VISION_TABLES 348. * creates huge (60K) tables at compile time, drastically increasing data 349. * size, but runs slightly faster than the alternate algorithm. (MSDOS in 350. * particular cannot tolerate the increase in data size; other systems can 351. * flip a coin weighted to local conditions.) 352. * 353. * If VISION_TABLES is defined, two-dimensional tables will be generated. 354. * Some compilers need braces around the rows of such arrays; some need 355. * them not to be there. Known preferences: 356. * Braces: Sun, DEC vaxen (Ultrix), DEC Mips 357. * Bull DPX/2 K&R (Green Hills) 358. * No Braces: gcc, hc (IBM High C compiler), AT&T 3B, MSC 5.1 359. * Bull DPX/2 Ansi (Green Hills/-Xa option), MPW C 360. * If VISION_TABLES is not defined, things will be faster if you can use 361. * MACRO_CPATH. Some cpps, however, cannot deal with the size of the 362. * functions that have been macroized. 363. */ 364. 365. /*#define VISION_TABLES /* use vision tables generated at compile time */ 366. #ifdef VISION_TABLES 367. # define BRACES /* put braces around rows of 2d arrays */ 368. #else 369. # define MACRO_CPATH /* use clear_path macros instead of functions */ 370. #endif 371. 372. 373. 374. /* 375. * Section 4: THE FUN STUFF!!! 376. * 377. * Conditional compilation of special options are controlled here. 378. * If you define the following flags, you will add not only to the 379. * complexity of the game but also to the size of the load module. 380. * 381. * Note: Commenting MULDGN will yield a game similar to 3.0, without 382. * Quest dungeons and tasks, and without some other special dungeons. 383. */ 384. 385. /* game features */ 386. #define POLYSELF /* Polymorph self code by Ken Arromdee */ 387. #define SOUNDS /* Add more life to the dungeon */ 388. /* dungeon features */ 389. #define SINKS /* Kitchen sinks - Janet Walz */ 390. /* dungeon levels */ 391. #define WALLIFIED_MAZE /* Fancy mazes - Jean-Christophe Collet */ 392. #define REINCARNATION /* Special Rogue-like levels */ 393. /* monsters & objects */ 394. #define KOPS /* Keystone Kops by Scott R. Turner */ 395. #define ARMY /* Soldiers, barracks by Steve Creps */ 396. #define SEDUCE /* Succubi/incubi seduction, by KAA, suggested by IM */ 397. #define WALKIES /* Leash code by M. Stephenson */ 398. #define TOURIST /* Tourist players with cameras and Hawaiian shirts */ 399. #define TUTTI_FRUTTI /* fruit option as in Rogue, but which works, by KAA */ 400. #define MUSE /* Let monsters use more things - KAA */ 401. #define MULDGN /* Multi-branch dungeons MRS & IM */ 402. /* difficulty */ 403. #define ELBERETH /* Engraving the E-word repels monsters */ 404. #define EXPLORE_MODE /* Allow non-scoring play with additional powers */ 405. /* I/O */ 406. #define REDO /* support for redoing last command - DGK */ 407. #define COM_COMPL /* Command line completion by John S. Bien */ 408. #ifndef AMIGA 409. # define CLIPPING /* allow smaller screens -- ERS */ 410. #endif 411. 412. #ifdef REDO 413. # define DOAGAIN '\001' /* ^A, the "redo" key used in cmd.c and getline.c */ 414. #endif 415. 416. #define EXP_ON_BOTL /* Show experience on bottom line */ 417. /* #define SCORE_ON_BOTL /* added by Gary Erickson (erickson@ucivax) */ 418. 419. #include "global.h" /* Define everything else according to choices above */ 420. 421. #endif /* CONFIG_H */ config.h